using System;
using System.Collections.Generic;
using System.Text;
using CommonTypes;
using MVCFramework.Models;


namespace MVCFramework.Presenter.Commands
{
    internal class ModifyCommand : Command 
    {
        Vector _vector;
        IModifiable _object;
        IModel _model;

        public ModifyCommand(IModel model,IModifiable _object, Vector _vector)
        {
            this._model = model;
            this._object = _object;
            this._vector = _vector;
        }

        public override bool Execute()
        {
            return _model.Modify(_object as IModelData , _vector);
            
        }
        public override bool UnExecute()
        {
            return _model.Modify(_object as IModelData , _vector*(-1));
         //   return _object.Move(_vector * (-1));
        }

        public override string Description
        {
            get
            {
                return "Object Moved ";
            }
            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }
    }
}
